{% extends 'base.html' %}

{% block title %}{{ verpose_name }}的数据显示{% endblock %}


{% block content %}

    <div class="luffy-container">
        <h1>{{ verpose_name }}的数据显示</h1>

        {% if search_group_row_list %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <i class="fa fa-filter" aria-hidden="true"></i>快速筛选
                </div>
                <div class="panel-body">
                    <div class="search-group">
                        {% for row in search_group_row_list %}
                            <div class="row">
                                {% for obj in row %}
                                    {{ obj |safe}}
                                {% endfor %}
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
        {% endif %}


        {% if search_list %}
            <div style="float:right;margin: 5px 0; ">
                <form method="get" class="form-inline">
                    <div class="form-group">
                        <input type="text" class="form-control" name="q" value="{{ search_value }}" placeholder="关键字模糊搜索">
                        <button class="btn btn-primary" type="submit">
                            <i class="fa fa-search" aria-hidden="true"></i>
                        </button>
                    </div>
                </form>
            </div>
        {% endif %}

        <form method="post" >
            {% csrf_token %}
            {% if action_dict %}
                <div style="float: left;margin: 5px 10px 5px 0;">
                    <div class="form-inline">
                        <div class="form-group">
                                <select name="action" id="" class="form-control">
                                    <option value="">请选择操作</option>
                                    {% for func_name, func_text in action_dict.items %}
                                    <option value="{{ func_name }}">{{func_text}}</option>
                                    {% endfor %}
                                </select>
                                <input type="submit"  class="btn btn-primary" value="执行">
                                {% if multi_info %}<span style="color: red;">{{ multi_info }}</span> {% endif %}
                        </div>
                    </div>
                </div>
            {% endif %}

            {% if add_btn %}
                <div style="margin: 5px 0;float:left;">
                    {{ add_btn|safe }}
                </div>
            {% endif %}

            <table class="table table-bordered t">
                <thead>
                    <tr>
                        {% for key in head_list %}
                            <th>{{ key }}</th>
                        {% endfor %}
                    </tr>
                </thead>
                <tbody>
                    {% for row in object_list %}
                        <tr>
                            {% for item in row  %}
                                <td>{{ item }}</td>
                            {% endfor %}
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </form>


        <nav>
            <ul class="pagination">
                {{ pager.page_html|safe }}
            </ul>
        </nav>
    </div>
{% endblock %}